﻿@using DataMongo
@model IEnumerable<DataMongo.Entities.FeedPost>
@{
    ViewBag.Title = "UpdateUpcoming";
}



<table class="table table-bordered table-hover table-striped tablesorter" style="font-size:12px;">
    <thead>
        <tr>
            <th>Title <i class="fa fa-sort"></i></th>
            <th width="30%">Description <i class="fa fa-sort"></i></th>
            <th width="10%">Source <i class="fa fa-sort"></i></th>
            <th>Category<i class="fa fa-sort"></i></th>
            <th>Image<i class="fa fa-sort"></i></th>
            <th>Source Link<i class="fa fa-sort"></i></th>
            <th width="20%">

            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.OrderByDescending(x => x.IsUpcoming))
        {
            <tr>
                <td>@item.Title</td>
                <td>@item.ShortDescription</td>
                <td>@UtilityService.GetSourceNameById(item.SourceId)</td>
                <td>@UtilityService.GetCategoryNameById(item.CategoryId)</td>

                <td><img src="@item.ImageURL1" height="70px" width="70px" /></td>
                <td>@item.SourceLink</td>
                <td>
                    @Html.ActionLink("Edit", "FeedPostEdit", new { id = item.FeedPostId }) |
                    @Html.ActionLink("Delete", "FeedPostDelete", new { id = item.FeedPostId }) |

                    <a href="javascript:void(0)" class="upcomingLink" data-id="@item.FeedPostId">
                        @if (item.IsUpcoming)
                        {
                            <text> Cancel Upcoming </text>
                        }
                        else
                        {
                            <text> Make Upcoming </text>
                        }
                    </a>
                </td>
            </tr>
        }
    </tbody>
</table>